import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/views/index.vue'),
      children: [
        { path: '/system/user', name: 'user', component: () => import('../views/system/user.vue') },
        { path: '/system/menu', name: 'menu', component: () => import('../views/system/menu.vue') },
        { path: '/system/role', name: 'role', component: () => import('../views/system/role.vue') },
      ]
    },
  ],
})

export default router
